package com.teamwork.module03.controller;

import com.teamwork.module03.service.LoginService;
import com.teamwork.common.entity.common.User;
import com.teamwork.common.result.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@Slf4j
@RequestMapping("/api")
public class LoginController {

    @Resource
    private LoginService loginServcie;

    @PostMapping("/user/login")
    public Result login(@RequestBody User user){
        log.info("user{}",user);
        return loginServcie.login(user);
    }
    @GetMapping("/user/loginout")
    public Result loginout(){
        return loginServcie.logout();
    }
}

